/**
 * Search managing class.
 * It handles the button 'Advanced search' and 'Simple search'
 * 
 * @return
 */
var Search = {
	advancedDiv: null,
	searchClickAdvanced: null,
	searchClickSimple: null,
	searchElem: null,
	isNotInitialized: true,
	visible: false,
	advanced: function() {
		if (this.visible) {
			console.log("hide advance search");
			Common.makeVisible(this.searchClickAdvanced);
			Common.makeInvisible(this.searchClickSimple);
			Common.makeInvisible(this.advancedDiv);
			this.searchElem.style.height = "33px";
			this.visible = false;
		} else {
			console.log("show advance search");
			this.searchElem.style.height = "";
			Common.makeInvisible(this.searchClickAdvanced);
			Common.makeVisible(this.searchClickSimple);
			Common.makeVisible(this.advancedDiv);
			this.visible = true;
		}
	},
	/**
	 * Initialization of search object.
	 */
	init: function() {
		onLoad.add(function() {
			console.log("search init");
			that = Search;
			that.advancedDiv = document.getElementById('searchAdvanced');
			that.searchElem = document.getElementById('search');
			that.searchClickAdvanced = document.getElementById('searchClickAdvanced');
			that.searchClickSimple = document.getElementById('searchClickSimple');
			that.isNotInitialized = false;
			console.log(Search.advancedDiv);
		});
	}
};
Search.init();
